<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/img/avatar/pear.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/img/avatar/pear-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/img/avatar/pear-16x16.png">
  <link rel="mask-icon" href="/img/avatar/pear.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=FiraGo:300,300italic,400,400italic,700,700italic%7CSource+Han+Sans+SC:300,300italic,400,400italic,700,700italic%7CFira+Code:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css" integrity="sha256-mUZM63G8m73Mcidfrv5E+Y61y7a12O5mW4ezU3bxqW4=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"syvshc.gitee.io","root":"/","images":"/images","scheme":"Gemini","version":"8.7.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":true,"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"buttons","active":"gitalk","storage":true,"lazyload":true,"nav":{"gitalk":{"order":-2}},"activeClass":"gitalk"},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":5,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>
<meta name="description" content="在 NexT 主题更新 8.0 之后又重新配置了一次 hexo+NexT, 这次来记录一下, 并且会随时更新新增的配置.">
<meta property="og:type" content="article">
<meta property="og:title" content="搭建 github.io">
<meta property="og:url" content="https://syvshc.gitee.io/2021-03-03-build-github-io/index.html">
<meta property="og:site_name" content="无锤乙醇">
<meta property="og:description" content="在 NexT 主题更新 8.0 之后又重新配置了一次 hexo+NexT, 这次来记录一下, 并且会随时更新新增的配置.">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://pic4.zhimg.com/80/v2-8c21ffd0058d9cba4be5da45c49f1663.png">
<meta property="og:image" content="https://pic4.zhimg.com/80/v2-797a1b83cb08f7653adcb43d56838b8c.png">
<meta property="og:image" content="https://pic4.zhimg.com/80/v2-8121a42938033c596ae6e0a8022d1bcd.png">
<meta property="og:image" content="https://pic4.zhimg.com/80/v2-d115746d176f5fb3a6aa6ac7d05e73ba.png">
<meta property="article:published_time" content="2021-03-03T15:16:26.000Z">
<meta property="article:modified_time" content="2021-11-19T04:47:46.513Z">
<meta property="article:author" content="Zhonghao Sun">
<meta property="article:tag" content="配置记录">
<meta property="article:tag" content="帮助文档">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pic4.zhimg.com/80/v2-8c21ffd0058d9cba4be5da45c49f1663.png">


<link rel="canonical" href="https://syvshc.gitee.io/2021-03-03-build-github-io/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://syvshc.gitee.io/2021-03-03-build-github-io/","path":"2021-03-03-build-github-io/","title":"搭建 github.io"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>搭建 github.io | 无锤乙醇</title>
  
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-127047099-2","only_pageview":true}</script>
  <script src="/js/third-party/analytics/google-analytics.js"></script>




  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">无锤乙醇</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">学而未精</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li>
        <li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li>
        <li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
        <li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C"><span class="nav-number">1.</span> <span class="nav-text">准备工作</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93"><span class="nav-number">1.1.</span> <span class="nav-text">创建仓库</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%89%E8%A3%85-node.js"><span class="nav-number">1.2.</span> <span class="nav-text">安装 node.js</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9D%E5%A7%8B%E5%8C%96%E5%8D%9A%E5%AE%A2"><span class="nav-number">1.3.</span> <span class="nav-text">初始化博客</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%83%A8%E7%BD%B2%E5%8D%9A%E5%AE%A2"><span class="nav-number">2.</span> <span class="nav-text">部署博客</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9C%AC%E5%9C%B0%E9%83%A8%E7%BD%B2"><span class="nav-number">2.1.</span> <span class="nav-text">本地部署</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9C%A8%E7%BA%BF%E9%83%A8%E7%BD%B2"><span class="nav-number">2.2.</span> <span class="nav-text">在线部署</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E5%8D%9A%E6%96%87"><span class="nav-number">3.</span> <span class="nav-text">创建博文</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%B0%E5%BB%BA%E5%8D%9A%E6%96%87"><span class="nav-number">3.1.</span> <span class="nav-text">新建博文</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BE%8E%E5%8C%96%E7%95%8C%E9%9D%A2"><span class="nav-number">4.</span> <span class="nav-text">美化界面</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF"><span class="nav-number">4.1.</span> <span class="nav-text">配置基本信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9B%B4%E6%8D%A2%E4%B8%BB%E9%A2%98"><span class="nav-number">4.2.</span> <span class="nav-text">更换主题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%8B%E9%9D%A2%E9%85%8D%E7%BD%AE-next-%E4%B8%BB%E9%A2%98%E7%9A%84%E4%B8%80%E4%BA%9B%E4%BA%8B%E9%A1%B9-%E8%BF%99%E9%87%8C%E5%8F%AA%E4%BB%8B%E7%BB%8D%E4%B8%80%E4%BA%9B%E5%8A%9F%E8%83%BD%E7%9A%84%E4%BD%9C%E7%94%A8-%E5%B9%B6%E4%B8%8D%E5%85%B7%E4%BD%93%E9%85%8D%E7%BD%AE."><span class="nav-number">4.3.</span> <span class="nav-text">下面配置 NexT 主题的一些事项, 这里只介绍一些功能的作用, 并不具体配置.</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%BF%99%E6%98%AF%E4%B8%80%E4%BA%9B%E4%B8%8D%E7%9F%A5%E9%81%93%E6%94%BE%E5%88%B0%E5%93%AA%E9%87%8C%E7%9A%84%E9%85%8D%E7%BD%AE"><span class="nav-number">4.4.</span> <span class="nav-text">这是一些不知道放到哪里的配置</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9C%AA%E5%AE%8C%E5%BE%85%E7%BB%AD"><span class="nav-number">5.</span> <span class="nav-text">未完待续</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-overview">
            <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Zhonghao Sun"
      src="/img/avatar/qqavatar.jpg">
  <p class="site-author-name" itemprop="name">Zhonghao Sun</p>
  <div class="site-description" itemprop="description">从未想过背叛, 也不必说忠贞</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">17</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">18</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/syvshc" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;syvshc" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:syvshc@foxmail.com" title="E-Mail → mailto:syvshc@foxmail.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://tex.stackexchange.com/users/180617/syvshc" title="TeX.SE → https:&#x2F;&#x2F;tex.stackexchange.com&#x2F;users&#x2F;180617&#x2F;syvshc" rel="noopener" target="_blank"><i class="fab fa-stack-exchange fa-fw"></i>TeX.SE</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://studio.youtube.com/channel/UCqvoLd2tlB_xuRkZ7_GYOVw/editing/details" title="YouTube → https:&#x2F;&#x2F;studio.youtube.com&#x2F;channel&#x2F;UCqvoLd2tlB_xuRkZ7_GYOVw&#x2F;editing&#x2F;details" rel="noopener" target="_blank"><i class="fab fa-youtube fa-fw"></i>YouTube</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.worldcubeassociation.org/persons/2015SUNZ03/" title="WCA → https:&#x2F;&#x2F;www.worldcubeassociation.org&#x2F;persons&#x2F;2015SUNZ03&#x2F;" rel="noopener" target="_blank"><i class="fas fa-cubes fa-fw"></i>WCA</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://steamcommunity.com/id/syvshc" title="Steam → https:&#x2F;&#x2F;steamcommunity.com&#x2F;id&#x2F;syvshc" rel="noopener" target="_blank"><i class="fab fa-steam fa-fw"></i>Steam</a>
      </span>
  </div>
  <div class="cc-license site-overview-item animated" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" class="cc-opacity" rel="noopener" target="_blank"><img src="https://cdn.jsdelivr.net/npm/@creativecommons/vocabulary@2020.11.3/assets/license_badges/small/by_nc_sa.svg" alt="Creative Commons"></a>
  </div>


  <div class="links-of-blogroll site-overview-item animated">
    <div class="links-of-blogroll-title"><i class="fas fa-link fa-fw"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.latexstudio.net/" title="https:&#x2F;&#x2F;www.latexstudio.net" rel="noopener" target="_blank">LaTeX 工作室</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://sikouhjw.github.io/" title="https:&#x2F;&#x2F;sikouhjw.github.io&#x2F;" rel="noopener" target="_blank">sikouhjw</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://zhuanlan.zhihu.com/typography-and-latex/" title="https:&#x2F;&#x2F;zhuanlan.zhihu.com&#x2F;typography-and-latex&#x2F;" rel="noopener" target="_blank">muzimuzhi</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://liam.page/" title="https:&#x2F;&#x2F;liam.page&#x2F;" rel="noopener" target="_blank">Liam</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://stone-zeng.github.io/" title="https:&#x2F;&#x2F;stone-zeng.github.io&#x2F;" rel="noopener" target="_blank">stone-zeng</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://muyuuuu.github.io/" title="https:&#x2F;&#x2F;muyuuuu.github.io&#x2F;" rel="noopener" target="_blank">兰铃</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://yuxtech.club/" title="http:&#x2F;&#x2F;yuxtech.club&#x2F;" rel="noopener" target="_blank">yuxtech</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://camusecao.top/" title="https:&#x2F;&#x2F;camusecao.top&#x2F;" rel="noopener" target="_blank">CamuseCao</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.alanshawn.com/" title="https:&#x2F;&#x2F;www.alanshawn.com&#x2F;" rel="noopener" target="_blank">Alan Xiang</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://ssayno.github.io/" title="https:&#x2F;&#x2F;ssayno.github.io&#x2F;" rel="noopener" target="_blank">ssayno</a>
        </li>
    </ul>
  </div>

          </div>
        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/syvshc" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://syvshc.gitee.io/2021-03-03-build-github-io/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/img/avatar/qqavatar.jpg">
      <meta itemprop="name" content="Zhonghao Sun">
      <meta itemprop="description" content="从未想过背叛, 也不必说忠贞">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="无锤乙醇">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          搭建 github.io
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-03-03 23:16:26" itemprop="dateCreated datePublished" datetime="2021-03-03T23:16:26+08:00">2021-03-03</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">更新于</span>
        <time title="修改时间：2021-11-19 12:47:46" itemprop="dateModified" datetime="2021-11-19T12:47:46+08:00">2021-11-19</time>
      </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3/" itemprop="url" rel="index"><span itemprop="name">帮助文档</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3/blog/" itemprop="url" rel="index"><span itemprop="name">blog</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>4.1k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>4 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <p><strong>在 NexT 主题更新 8.0 之后又重新配置了一次 <code>hexo+NexT</code>, 这次来记录一下, 并且会随时更新新增的配置.</strong></p>
<span id="more"></span>
<h2 id="准备工作">准备工作</h2>
<p>假定用户的电脑上已经安装 <code>git</code>, 并且已经与 <a href="github.com">github</a> 连接, 并熟悉 <code>git</code> 的相关操作.</p>
<h3 id="创建仓库">创建仓库</h3>
<p>在 <a href="github.com">github</a> 上新建一个仓库, 名称为 <code>&lt;username&gt;.github.io</code>, 将 <code>&lt;username&gt;</code> 替换为你的 <code>github</code> 账户名.</p>
<h3 id="安装-node.js">安装 <code>node.js</code></h3>
<p>在 <a target="_blank" rel="noopener" href="https://nodejs.org/en/">node.js的官网</a> 上下载 <code>LTS</code> 版本安装, 记得勾选 <code>ADD TO PATH</code>. 安装后在命令行输入 <code>npm -v</code>, 如果有版本号输出, 那么说明安装成功, 如果返回 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&#x27;npm&#x27;</span> 不是内部或外部命令，也不是可运行的程序或批处理文件。</span><br></pre></td></tr></table></figure> 那么将 <code>&lt;InstallPath&gt;/nodejs</code> 添加到环境变量. 然后命令行运行 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo-cli</span><br></pre></td></tr></table></figure> 安装 <code>hexo</code>, 确保安装后可以运行 <code>hexo</code> 命令.</p>
<h3 id="初始化博客">初始化博客</h3>
<p>用 <code>cmd</code> 进入想存放博客的文件夹, 运行 <code>hexo init &lt;blogname&gt;</code>, 将 <code>&lt;blogname&gt;</code> 替换成博客的项目名, 比如 <code>hexotest</code>. 因为 <code>hexo init</code> 的过程要链接 <code>github</code>, 如果出现卡顿, 可以尝试看这个<a target="_blank" rel="noopener" href="https://weilining.github.io/201021.html">博客</a>尝试解决.</p>
<p>初始化结束后会看到这样的文件树</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">hexotest</span><br><span class="line"> ├── db.json</span><br><span class="line"> ├── node_modules</span><br><span class="line"> ├── package-lock.json</span><br><span class="line"> ├── package.json</span><br><span class="line"> ├── public</span><br><span class="line"> ├── scaffolds</span><br><span class="line"> ├── source</span><br><span class="line"> ├── themes</span><br><span class="line"> ├── _config.landscape.yml</span><br><span class="line"> └── _config.yml</span><br></pre></td></tr></table></figure>
<h2 id="部署博客">部署博客</h2>
<h3 id="本地部署">本地部署</h3>
<p>我们进入 <code>hexotest</code> 文件夹, 输入</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo g</span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure>
<p>会有如下输出</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">INFO  Validating config</span><br><span class="line">INFO  Start processing</span><br><span class="line">INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.</span><br></pre></td></tr></table></figure>
<p>这时在浏览器中输入 <code>localhost:4000</code> 即可看到部署在本地的博客</p>
<p><img src="https://pic4.zhimg.com/80/v2-8c21ffd0058d9cba4be5da45c49f1663.png" /></p>
<p>然后我们命令行输入 <code>ctrl+C</code> 来结束本地部署.</p>
<h3 id="在线部署">在线部署</h3>
<p>当然我们写博客的目的大多都是要上传到互联网, 于是我们要把博客部署到 <code>&lt;username&gt;.github.io</code>.</p>
<p>首先安装部署插件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git</span><br></pre></td></tr></table></figure>
<p>打开 <code>hexotest</code> 下的 <code>_config.yml</code> 配置文件, 找到 <code>deploy</code>, 填入以下信息</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Deployment</span></span><br><span class="line"><span class="comment">## Docs: https://hexo.io/docs/deployment.html</span></span><br><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">&lt;git</span> <span class="string">repo</span> <span class="string">ssh</span> <span class="string">address&gt;</span></span><br><span class="line">  <span class="attr">branch:</span> <span class="string">master</span></span><br></pre></td></tr></table></figure>
<p>再运行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo d</span><br></pre></td></tr></table></figure>
<p>等待部署成功, 成功后就可以在 <code>&lt;username&gt;.github.io</code> 上看到博客的内容了.</p>
<h2 id="创建博文">创建博文</h2>
<h3 id="新建博文">新建博文</h3>
<p>在 <code>hexotest/</code> 文件夹下, 用 <code>cmd</code> 执行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo n <span class="string">&quot;&lt;blog_name&gt;&quot;</span></span><br></pre></td></tr></table></figure>
<p>将 <code>&lt;blog_name&gt;</code> 替换为博文的名字, 注意不能有空格, 这里我们使用 <code>hexo n "first-blog"</code>, 成功后会在 <code>source/_posts/</code> 文件夹下看到 <code>first-blog.md</code> 文件</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">source</span><br><span class="line">└── _posts</span><br><span class="line">   ├── first-blog.md</span><br><span class="line">   └── hello-world.md</span><br></pre></td></tr></table></figure>
<p>同时我们还发现了另一个文件 <code>hello-world.md</code>, 这就是我们在本地部署成功后看到的那一篇博文.</p>
<p>用熟悉的编辑器打开 <code>first-blog.md</code>, 将其内容修改为</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 第一篇博文</span><br><span class="line">date: 2021-03-04 00:32:07</span><br><span class="line">tags:</span><br><span class="line">    - [博文]</span><br><span class="line">    - [测试]</span><br><span class="line">    - [whatever]</span><br><span class="line">categories:</span><br><span class="line">    - [测试, 测试的子分类]</span><br><span class="line">---</span><br><span class="line">这是我的第一篇博文</span><br></pre></td></tr></table></figure>
<p>其中 <code>tags</code> 与 <code>categories</code> 可以自行设置, 它们的关系可以参考这个<a target="_blank" rel="noopener" href="https://www.zhihu.com/question/19561626">问题</a></p>
<p>再使用 <code>hexo g &amp;&amp; hexo s</code> 进行本地部署, 在 <code>localhost:4000</code> 看到刚刚编辑的博文"第一篇博文", 点进去可以看到</p>
<p><img src="https://pic4.zhimg.com/80/v2-797a1b83cb08f7653adcb43d56838b8c.png" /></p>
<p>然后可以再使用 <code>hexo d</code> 将其推送到 <code>&lt;username&gt;.github.io</code>, 等待一会如果没有更新内容, 那么就执行一下 <code>hexo clean</code> 来清空部署缓存. 于是我们将博文推送到远端的命令可以归为</p>
<p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</span><br></pre></td></tr></table></figure></p>
<h2 id="美化界面">美化界面</h2>
<h3 id="配置基本信息">配置基本信息</h3>
<p>配置文件 <code>hexotest/_config.yml</code> 是对应于我们博客的最高级的配置文件, 里面有一些字段可以进行配置, 作为示例修改了下面几项</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"># Site</span><br><span class="line">title: SYVHSC&#39;s BLOG</span><br><span class="line">subtitle: &#39;&#39;</span><br><span class="line">description: &#39;无锤乙醇的博客&#39;</span><br><span class="line">keywords: LaTeX, 数学</span><br><span class="line">author: 无锤乙醇</span><br><span class="line">language: zh-CN</span><br><span class="line">timezone: Asia&#x2F;Shanghai</span><br></pre></td></tr></table></figure>
<p>进行本地部署可以看到</p>
<p><img src="https://pic4.zhimg.com/80/v2-8121a42938033c596ae6e0a8022d1bcd.png" /></p>
<h3 id="更换主题">更换主题</h3>
<p>这里我们选用 <code>NexT</code> 主题进行配置. 由于 <code>NexT8.0+</code> 已经支持 <code>npm</code> 安装, 于是可以在目录 <code>hexotest/</code> 下用 <code>cmd</code> 执行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-theme-next</span><br></pre></td></tr></table></figure>
<p>并在 <code>hexotest/_config.yml</code> 中找到 <code>theme</code> 字段, 修改为 <code>theme: next</code>, 保存后本地部署, 可以看到博客的主题已经更换</p>
<p><img src="https://pic4.zhimg.com/80/v2-d115746d176f5fb3a6aa6ac7d05e73ba.png" /></p>
<p>然后我们可以把 <code>node_modules/hexo-theme-next/</code> 中的 <code>_config.yml</code> 改为 <code>_config.next.yml</code> 并且复制到根目录 <code>hexotest/</code> 下进行修改, 这样当我们升级 <code>NexT</code> 主题的时候不需要重新配置.</p>
<h3 id="下面配置-next-主题的一些事项-这里只介绍一些功能的作用-并不具体配置.">下面配置 <code>NexT</code> 主题的一些事项, 这里只介绍一些功能的作用, 并不具体配置.</h3>
<ol type="1">
<li><strong>scheme</strong> <code>NexT</code> 主题内置了 4 种样式, 可以依次启用来选择一个适合自己的, 这里我选择了 <code>Gemini</code>;</li>
<li><strong>favicon</strong> 配置标签页的图标, 可以自行选择图片, 放在 <code>hexotest/source/img</code> 文件夹下便于寻找, 设置中的路径也应改为 <code>/img/***.png(jpg, svg...)</code>;</li>
<li><strong>menu</strong> 配置博客页面的链接;</li>
<li><strong>social</strong> 配置博客页面的外部链接, 图标可以在 <a target="_blank" rel="noopener" href="https://fontawesome.com/">fontawsome</a> 进行选择;</li>
<li><strong>avatar</strong> 配置博客侧边栏的头像, 图片选择同 <strong>favicon</strong>;</li>
<li><strong>toc</strong> 配置浏览博文时侧边栏的目录;</li>
<li><strong>font</strong> 配置文章中的字体; 在 <code>_config.next.yml</code> 中不能配置多种字体, 如果想配置多种字体, 可以修改 <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexotest\node_modules\hexo-theme-next\source\css\_variables\base.styl</span><br></pre></td></tr></table></figure> 中的 <code>\\Font families</code> 中的值</li>
<li><strong>codeblock</strong> 配置代码块;</li>
<li><strong>back2top</strong> 配置返回顶部的按钮;</li>
<li><strong>reading_progress</strong> 配置阅读进度条;</li>
<li><strong>symbols_count_time</strong> 配置站点字数和阅读时间统计, <a target="_blank" rel="noopener" href="https://github.com/next-theme/hexo-word-counter">使用方法</a>;</li>
<li><strong>creative_commons</strong> 配置文末版权信息, 关于 cc 协议可以参考<a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/20641764">知乎专栏</a>;</li>
<li><strong>local_search</strong> 配置搜索栏, <a target="_blank" rel="noopener" href="https://github.com/theme-next/hexo-generator-searchdb">使用方法</a>;</li>
<li><strong>links_settings &amp; links</strong> 配置友情链接;</li>
</ol>
<h3 id="这是一些不知道放到哪里的配置">这是一些不知道放到哪里的配置</h3>
<ol type="1">
<li><p><strong>markdown-it-plus</strong> 可以提供脚注等功能, 目录, emoji, katex 等功能, <a target="_blank" rel="noopener" href="https://github.com/CHENXCHEN/hexo-renderer-markdown-it-plus">使用方法</a> emoji 功能与 <code>hexo-renderer-pandoc</code> 冲突;</p></li>
<li><p><strong>hexo-renderer-pandoc</strong> 提供 mathjax 渲染, 将 <code>tags</code> 设置为 <code>ams</code> 还可以使用公式编号<a target="_blank" rel="noopener" href="https://theme-next.js.org/docs/third-party-services/math-equations">使用方法</a>;</p>
<p>示例: <figure class="highlight tex"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">一元二次方程组 $ax^&#123;2&#125;+bx+c&#x3D;0\ (a \ne 0)$ 的解为 $\eqref&#123;eq:slo&#125;$</span><br><span class="line">% 注意: 行内公式的 $...$ 前后不要有空格</span><br><span class="line">\begin&#123;equation&#125;\label&#123;eq:slo&#125;</span><br><span class="line">     x_&#123;1, 2&#125;&#x3D;\frac&#123;-b\pm\sqrt&#123;b^&#123;2&#125;-4ac&#125;&#125;&#123;2a&#125;</span><br><span class="line">\end&#123;equation&#125;</span><br></pre></td></tr></table></figure> 一元二次方程组 <span class="math inline">\(ax^{2}+bx+c=0\ (a \ne 0)\)</span> 的解为 <span class="math inline">\(\eqref{eq:slo}\)</span><br />
<span class="math display">\[\begin{equation}\label{eq:slo}
     x_{1, 2}=\frac{-b\pm\sqrt{b^{2}-4ac}}{2a}
\end{equation}\]</span></p></li>
<li><p><strong>gitalk</strong> 配置评论区. 配置方法在 <a href="/2021-03-05-enable-gitalk/" title="为博客添加 Gitalk 评论区">为博客添加 Gitalk 评论区</a>.</p></li>
<li><p><strong>busuanzi</strong> 配置阅读访问量. 在 <code>hexotest/</code> 文件夹下运行 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install busuanzi.pure.js --save</span><br></pre></td></tr></table></figure> 来安装不蒜子阅读访问量插件, 在 <code>_config.next.yml</code> 文件中搜索 <code>busuanzi</code> 即可找到 <figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Show Views / Visitors of the website / page with busuanzi.</span></span><br><span class="line"><span class="comment"># For more information: http://ibruce.info/2015/04/04/busuanzi/</span></span><br><span class="line"><span class="attr">busuanzi_count:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">total_visitors:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">total_visitors_icon:</span> <span class="string">fa</span> <span class="string">fa-user</span></span><br><span class="line">  <span class="attr">total_views:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">total_views_icon:</span> <span class="string">fa</span> <span class="string">fa-eye</span></span><br><span class="line">  <span class="attr">post_views:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">post_views_icon:</span> <span class="string">far</span> <span class="string">fa-eye</span></span><br></pre></td></tr></table></figure> 把 <code>enable</code> 字段改为 <code>true</code> 即可开启. 使用 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g -d</span><br></pre></td></tr></table></figure> 部署到线上, 如果没有刷新, 使用 <code>ctrl+f5</code> 进行强制刷新即可.</p></li>
</ol>
<h2 id="未完待续">未完待续</h2>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="reward-container">
  <div></div>
  <button>
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/img/avatar/wechatpay.png" alt="Zhonghao Sun 微信">
        <span>微信</span>
      </div>
      <div>
        <img src="/img/avatar/alipay.jpg" alt="Zhonghao Sun 支付宝">
        <span>支付宝</span>
      </div>

  </div>
</div>

          

<div class="post-copyright">
<ul>
  <li class="post-copyright-author">
      <strong>本文作者： </strong>Zhonghao Sun
  </li>
  <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="https://syvshc.gitee.io/2021-03-03-build-github-io/" title="搭建 github.io">https://syvshc.gitee.io/2021-03-03-build-github-io/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

          <div class="post-tags">
              <a href="/tags/%E9%85%8D%E7%BD%AE%E8%AE%B0%E5%BD%95/" rel="tag"># 配置记录</a>
              <a href="/tags/%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3/" rel="tag"># 帮助文档</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2021-03-03-beamer-font-set/" rel="prev" title="beamer 的字体设置">
                  <i class="fa fa-chevron-left"></i> beamer 的字体设置
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2021-03-04-learn-latexmk/" rel="next" title="latexmk 的学习">
                  latexmk 的学习 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    <div class="comments gitalk-container"></div>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Syvshc</span>
</div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
    <span title="站点总字数">68k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">1:02</span>
  </span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  
<script src="/js/third-party/search/local-search.js"></script>




  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"ams","js":{"url":"https://cdn.jsdelivr.net/npm/mathjax@3.2.0/es5/tex-mml-chtml.js","integrity":"sha256-r+3itOMtGGjap0x+10hu6jW/gZCzxHsoKrOd7gyRSGY="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.css" integrity="sha256-AJnUHL7dBv6PGaeyPQJcgQPDjt/Hn/PvYZde1iqfp8U=" crossorigin="anonymous">

<script class="next-config" data-name="gitalk" type="application/json">{"enable":true,"github_id":"syvshc","repo":"syvshc.github.io","client_id":"da0debc4d456cb5f3371","client_secret":"14ec65d19a969abe01994143eff233a4180484aa","admin_user":"syvshc","distraction_free_mode":true,"proxy":"https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token","language":"zh-CN","js":{"url":"https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.min.js","integrity":"sha256-Pmj85ojLaPOWwRtlMJwmezB/Qg8BzvJp5eTzvXaYAfA="},"path_md5":"320f3ec411070b35c8c20426be0b3162"}</script>
<script src="/js/third-party/comments/gitalk.js"></script>

</body>
</html>
